﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using MarketOnlineBUS;
using MarketOnlineDTO;

public partial class Search : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        //@Võ Quang Trọng
        if (!IsPostBack)
        {
            if (Session["key_search"] != null)
            {
                String key_search = Session["key_search"].ToString();
                Session["key_search"] = null;
                TimKiem(key_search);
            }
        }
    }

    
    
    //@Võ Quang Trọng
    public void TimKiem(String key_search)
    {
        SanPhamBUS spBUS = new SanPhamBUS();
        List<SanPhamDTO> list = new List<SanPhamDTO>();
        
        
        list = spBUS.TimKiemSanPham(key_search);
        listProduct.DataSource = list;
        listProduct.DataBind();
    }
}